package Day17.intereface_.Eight;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/24 18:18
 */
public class InterfacePolyPass {
    public static void main(String[] args) {
        //接口的多态体现
        //接口类型的变量if01可以指向实现了IF接口类的对象实例
        IF if01 = new Monster();
        if01 = new Car();

        //继承体现的多态
        //父类类型的变量aaa可以指向继承AAA的子类的对象实例
        AAA aaa = new AAA();
        aaa = new CCC();
    }
}
interface IF{

}
class Monster implements IF{

}
class Car implements  IF{

}
class AAA{

}

class  BBB extends AAA{

}
class  CCC extends AAA{

}